# Metview Macro

#  **************************** LICENSE START ***********************************
# 
#  Copyright 2015 ECMWF. This software is distributed under the terms
#  of the Apache License version 2.0. In applying this license, ECMWF does not
#  waive the privileges and immunities granted to it by virtue of its status as
#  an Intergovernmental Organization or submit itself to any jurisdiction.
# 
#  ***************************** LICENSE END ************************************

data = read_table(
    table_filename : "t2_20120304_1200.csv"
    )

print('Num cols: ', count(data))
print('Col 4: ', name(data, 4))
print('Num vals: ', count(values(data, 'T2m')))

lats = values(data, 'Lat')
lons = values(data, 'Lon')
vals = values(data, 'T2m')

num_vals = count(vals)

geo = create_geo(num_vals, 'xyv')
geo = set_latitudes (geo, lats)
geo = set_longitudes(geo, lons)
geo = set_values    (geo, vals)
return geo



